import socket

class TCPClientModule:
    def __init__(self):
        self.client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    def _AttemptConnect(self,name,port):
        try:
            self.client_socket.bind(name,port)
            return True
        except:
            return 'Failed to Connect to %s %s' % (name,port)

    def _SendData(self,data):
        self.client_socket.send(data)

    def _RecvData(self):
        return self.client_socket.recv(1024)
